<!-- 
 *  Copyright [2014] UW-Parkside
 * Authors: Jasmine Griffiths, Matthew Zygowicz, Armando Narvaez
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
*/
-->

<!-- 'hiddenRouteBoxMin.php' is the sticky window when the user is editing the box -->
<!-- Fields are:  ID, Location, Day, Time, and Direction      -->

<?php
print "<form id='addRouteForm2' action='/index.php/kat/addroute' method='POST'>";
?>
<p><strong>Add Stop for New Route</strong></p>
<hr />

<?php
if (!isset($_SESSION['mode'])) {//Check if route has been entered
    print "<p>";
    print "<label class='field' for='route'>Route</label>";
    print "<input class='reducedInput' name='routenumber' type='text' placeholder='' required=''>";
    print "</p>";
} else {//Hide route field when user entered route number
    print "<p class = 'hidden'>";
    print "<label hidden for='route'>Route</label>";
    print "<input hidden name='routenumber' type='text' value = '$_POST[routenumber]'>";
    print "</p>";
}
?>
<p>
    <label class="field" for="location">Location</label><!-- Location field -->
    <input id = "location" class="reducedInput" name="location" type="text" required="">
</p>

<p>
    <label class="field" for="day">Day</label><!-- Day field -->
	    <select class = "reducedInput" name="day">
        <option value="Weekend">Weekend</option><!-- Weekend option -->
        <option value="Weekday">Weekday</option><!-- Weekday option -->
    </select>
    <!--<input class="reducedInput" name="day" type="text" placeholder="" required=""> -->
</p>

<p>
    <label class="field" for="time">Time</label><!-- Time Field, Currently inputting as 24-hour as of May 7, 2014 -->
    <select id='hourSelect2' class='reducedInputTime' name='hour'>
    <?php
	for($i=1; $i < 13 ; $i++){
		  print "<option value='$i'>$i</option>";
	}
    ?>
    </select>
    <select id='minuteSelect2' class='reducedInputTime' name='minute'>
    <?php
	for($i=0; $i < 60 ; $i++){
		  if($i < 10)
			    print "<option value='$i'>0$i</option>";
		  else
			    print "<option value='$i'>$i</option>";
	}
    ?>
    </select>
    <select id='ampmSelect2' class='reducedInputTime' name='ampm'>
	<option value='am'>AM</option>
	<option value='pm'>PM</option>
    </select>
</p>

<!-- ID Field -->
<p class="hidden">
    <label hidden for="id">ID</label>
    <input id='id2' name="id" type="text" placeholder="" hidden >
</p>
<p>
    <label class="field" for="direction">Direction</label><!-- Direction field -->
    <select id='direction2' name="direction">
        <option value="North">North</option><!-- North option -->
        <option value="South">South</option><!-- South option -->
        <option value="East">East</option><!-- East option -->
        <option value="West">West</option><!-- West option -->
    </select>
</p>

<?php
if (isset($_SESSION['mode'])) {//Check if in 'editmode', create add/delete buttons
    print "<input class='reducedSize right yellow button' value='Add Stop' id='submit2' name='submit' type='submit'>";
    print "<input class='reducedSize right yellow button' value='Delete Stop' name='submit' type='submit'>";
} else {//Else, show only one button which is an "add route" button
    print "<input class='reducedSize right yellow button' value='Add Route' name='submit' type='submit' onclick = \"removeField()\">";
}
?>
<input class="reducedSize right blue button" value="Reset/Clear Form" name="reset" type="reset" onclick="resetAddRouteForm()">
</form>
